/*
 *  Copyright 2008 Mark Ashworth <javameme@gmail.com>.
 *
 *  Licensed under the GNU General Public License v3 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *       http://www.gnu.org/licenses/gpl-3.0.html
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *  under the License.
 */
package xperiment.metaphor.model.security;

import xperiment.metaphor.model.DomainObject;
import xperiment.metaphor.model.Persistent;

/**
 * The following is taken from Spring Security 2.0.3<br />
 * <code>
 * CREATE TABLE ACL_ENTRY(<br />
 * ID BIGINT GENERATED BY DEFAULT AS IDENTITY(START WITH 100) NOT NULL PRIMARY KEY,<br />
 * ACL_OBJECT_IDENTITY BIGINT NOT NULL,<br />
 * ACE_ORDER INT NOT NULL,<br />
 * SID BIGINT NOT NULL,<br />
 * MASK INTEGER NOT NULL,<br />
 * GRANTING BOOLEAN NOT NULL,<br />
 * AUDIT_SUCCESS BOOLEAN NOT NULL,<br />
 * AUDIT_FAILURE BOOLEAN NOT NULL,<br />
 * CONSTRAINT UNIQUE_UK_4 UNIQUE(ACL_OBJECT_IDENTITY,ACE_ORDER),<br />
 * CONSTRAINT FOREIGN_FK_4 FOREIGN KEY(ACL_OBJECT_IDENTITY) REFERENCES ACL_OBJECT_IDENTITY(ID),<br />
 * CONSTRAINT FOREIGN_FK_5 FOREIGN KEY(SID) REFERENCES ACL_SID(ID));<br />
 * </code>
 *
 * @author Mark Ashworth <javameme@gmail.com>
 * @version 1.0.0
 * @since 1.0.0
 */
public class ACLEntry extends DomainObject implements Persistent {
    private Long id;
    private int mask;
    private int order;
    private boolean granting;
    private boolean auditSuccess;
    private boolean auditFailure;
    private ACLObjectId objectId;
    private ACLSecurityId sid;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public int getMask() {
        return mask;
    }

    public void setMask(int mask) {
        this.mask = mask;
    }

    public int getOrder() {
        return order;
    }

    public void setOrder(int order) {
        this.order = order;
    }

    public boolean isGranting() {
        return granting;
    }

    public void setGranting(boolean granting) {
        this.granting = granting;
    }

    public boolean isAuditSuccess() {
        return auditSuccess;
    }

    public void setAuditSuccess(boolean auditSuccess) {
        this.auditSuccess = auditSuccess;
    }

    public boolean isAuditFailure() {
        return auditFailure;
    }

    public void setAuditFailure(boolean auditFailure) {
        this.auditFailure = auditFailure;
    }

    public ACLObjectId getObjectId() {
        return objectId;
    }

    public void setObjectId(ACLObjectId objectId) {
        this.objectId = objectId;
    }

    public ACLSecurityId getSid() {
        return sid;
    }

    public void setSid(ACLSecurityId sid) {
        this.sid = sid;
    }

    public boolean isEnabled() {
        return true;
    }
}
